package com.tueye.utils;

import java.util.HashMap;
import java.util.Map;

import org.springframework.web.context.WebApplicationContext;

/**
 * 公共不可改变常量类
 * 
 * @author hanxiaowei modify by yue 2008/12/24
 *         说明：ctx，PROJECTPATH，PROJECTADMINPATH,PROJECTTOPICPATH都是在系统启动的时候获得
 *         这样就不用去每次用reques获得了。
 *###################### modify################################
 *  author         date       description
 *  yuyue         2010-1-29   增加通过GRID封装的相应常量
 *                              1.增加一个classID
 *                              2.CLASS_MAPPING 存放健值对的MAP映射classID与class
 *#############################################################
 */
public class TuEyeConstant {

	// 后台管理员登录session标示符
	public static final String TUEYE_ADMIN = "TUEYE_ADMIN_INFO";

	/**
	 * add by yuyue 2008/12/24 when application start,the tueyeservelt will
	 * initialization and initialization the ctx
	 */
	public static WebApplicationContext ctx = null;

	/**
	 * the webserver project path like "D:\tomcat-6.0.18\webapps\TuEye"
	 * 
	 */
	public static String PROJECTPATH = null;
	/**
	 * the webserver project admin path like
	 * "D:\tomcat-6.0.18\webapps\TuEye\pages\admin"
	 * 
	 */
	public static String PROJECT_ADMIN_PATH = null;
	/**
	 * the webserver project admin path like
	 * "D:\tomcat-6.0.18\webapps\TuEye\pages\topics"
	 * 
	 */
	public static String PROJECT_TOPIC_PATH = null;
	
	/**
	 * add by hanxiaowei 2009-02-08
	 * 拿到项目系统路径
	 */
	public static String systemPath = null;

	public static void setSystemPath(String path) {
		if (systemPath == null) {
			systemPath = path;
		}
	}
	
	/**
	 * 
	 * 功能描述:  返回当前系统路径
	 * 修改人：david
	 * 修改时间：
	 * 修改原因：
	 *
	 * @return
	 */
	public static String getSystemPath(){
		if( systemPath == null ){
			systemPath=AppHelper.getWebAppPath();
		}
		return systemPath;	
	}
	
	/**
	 * session存放的前台登陆用户的标识
	 */
	public static String TUEYE_USER = "tueyeuser" ;
	
	public static String REPLACE_TOPIC_TITLE = "topic_title";//替换图片标题内容标示
	public static String REPLACE_TOPIC_DESCRIPTION = "topic_description";
	public static String REPLACE_TOPIC_IMGURL = "topic_imgurl";
	public static String REPLACE_TOP30 = "topic30";
	public static String REPLACE_TOP20 = "topic20";
	public static String REPLACE_TOPIC_IMGHREF = "topic_imgHref"; //连接的图片href
	public static String REPLACE_TOPIC_IMGALT = "topic_imgAlt";
	public static String REPLACE_TOPIC_IMGTITLE = "topic_imgTitle";
	public static String META_DESCRIPTION_CONTENT = "descriptionContent";
	public static String META_KEYWORDS_CONTENT = "keywordsContent";
		
	public static String CLASS_ID = "classID"; 
	public static  Map<String,String> CLASS_MAPPING = new HashMap<String,String>();
	public static String getClassStrByClasId(String classID){
		return CLASS_MAPPING.get(classID);
	}
}
